<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://doc.hyperf.io
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */

use App\Middleware\Auth\AdminMiddleware;
use App\Middleware\Auth\TeacherMiddleware;
use App\Middleware\Auth\UserMiddleware;
use Hyperf\HttpServer\Router\Router;

#短信
Router::addRoute(['GET'], '/sms/send/{mobile:\S+}', 'App\Common\Controller\SmsController@send');

#首页
Router::addRoute(['GET'], '/', 'App\Controller\IndexController@index');

#文件上传
Router::addRoute(['POST'],'/upload/index','App\Controller\UploadController@index');

#后台端
Router::addRoute(['POST'], '/admin/login/account', 'App\Module\Admin\Controller\LoginController@account');
#家
Router::addRoute(['GET'], '/admin/home/info', 'App\Module\Admin\Controller\HomeController@info',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/home/password', 'App\Module\Admin\Controller\HomeController@password',['middleware'=>[AdminMiddleware::class]]);
#教师模块
Router::addRoute(['GET'], '/admin/teacher/search', 'App\Module\Admin\Controller\TeacherController@search',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/teacher/add', 'App\Module\Admin\Controller\TeacherController@add',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/teacher/edit/{id:\d+}', 'App\Module\Admin\Controller\TeacherController@edit',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/teacher/getById/{id:\d+}', 'App\Module\Admin\Controller\TeacherController@getById',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/teacher/delete/{id:\d+}', 'App\Module\Admin\Controller\TeacherController@delete',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/teacher/show/{id:\d+}', 'App\Module\Admin\Controller\TeacherController@show',['middleware'=>[AdminMiddleware::class]]);
#孩子模块
Router::addRoute(['GET'], '/admin/child/search', 'App\Module\Admin\Controller\ChildController@search',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/child/add', 'App\Module\Admin\Controller\ChildController@add',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/child/edit/{id:\d+}', 'App\Module\Admin\Controller\ChildController@edit',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/child/getById/{id:\d+}', 'App\Module\Admin\Controller\ChildController@getById',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/child/delete/{id:\d+}', 'App\Module\Admin\Controller\ChildController@delete',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/child/parents/{id:\d+}', 'App\Module\Admin\Controller\ChildController@parents',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/child/unbind/{cid:\d+}/{uid:\d+}', 'App\Module\Admin\Controller\ChildController@unbind',['middleware'=>[AdminMiddleware::class]]);
#用户模块
Router::addRoute(['GET'], '/admin/user/search', 'App\Module\Admin\Controller\UserController@search',['middleware'=>[AdminMiddleware::class]]);
#足迹模块
Router::addRoute(['GET'], '/admin/foot/search', 'App\Module\Admin\Controller\FootController@search',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/foot/add', 'App\Module\Admin\Controller\FootController@add',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/foot/edit/{id:\d+}', 'App\Module\Admin\Controller\FootController@edit',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/foot/getById/{id:\d+}', 'App\Module\Admin\Controller\FootController@getById',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/foot/delete/{id:\d+}', 'App\Module\Admin\Controller\FootController@delete',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/foot/excellent/{id:\d+}', 'App\Module\Admin\Controller\FootController@excellent',['middleware'=>[AdminMiddleware::class]]);
#作品模块
Router::addRoute(['GET'], '/admin/works/search', 'App\Module\Admin\Controller\WorksController@search',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/works/add', 'App\Module\Admin\Controller\WorksController@add',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/works/edit/{id:\d+}', 'App\Module\Admin\Controller\WorksController@edit',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/works/getById/{id:\d+}', 'App\Module\Admin\Controller\WorksController@getById',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/works/delete/{id:\d+}', 'App\Module\Admin\Controller\WorksController@delete',['middleware'=>[AdminMiddleware::class]]);
#活动模块
Router::addRoute(['GET'], '/admin/activity/search', 'App\Module\Admin\Controller\ActivityController@search',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/activity/add', 'App\Module\Admin\Controller\ActivityController@add',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/activity/getById/{id:\d+}', 'App\Module\Admin\Controller\ActivityController@getById',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/activity/edit/{id:\d+}', 'App\Module\Admin\Controller\ActivityController@edit',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/activity/show/{id:\d+}', 'App\Module\Admin\Controller\ActivityController@show',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/activity/finish/{id:\d+}', 'App\Module\Admin\Controller\ActivityController@finish',['middleware'=>[AdminMiddleware::class]]);
#新闻模块
Router::addRoute(['GET'], '/admin/news/search', 'App\Module\Admin\Controller\NewsController@search',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/news/add', 'App\Module\Admin\Controller\NewsController@add',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/news/edit/{id:\d+}', 'App\Module\Admin\Controller\NewsController@edit',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/news/getById/{id:\d+}', 'App\Module\Admin\Controller\NewsController@getById',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/news/delete/{id:\d+}', 'App\Module\Admin\Controller\NewsController@delete',['middleware'=>[AdminMiddleware::class]]);
#轮播模块
Router::addRoute(['GET'], '/admin/roll/search', 'App\Module\Admin\Controller\RollController@search',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/roll/add', 'App\Module\Admin\Controller\RollController@add',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/roll/edit/{id:\d+}', 'App\Module\Admin\Controller\RollController@edit',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/roll/getById/{id:\d+}', 'App\Module\Admin\Controller\RollController@getById',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/roll/delete/{id:\d+}', 'App\Module\Admin\Controller\RollController@delete',['middleware'=>[AdminMiddleware::class]]);
#支付记录模块
Router::addRoute(['GET'], '/admin/pay/search', 'App\Module\Admin\Controller\PayController@search',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['GET'], '/admin/pay/use/{id:\d+}', 'App\Module\Admin\Controller\PayController@use',['middleware'=>[AdminMiddleware::class]]);
#积分模块
Router::addRoute(['GET'], '/admin/score/search', 'App\Module\Admin\Controller\ScoreController@search',['middleware'=>[AdminMiddleware::class]]);
Router::addRoute(['POST'], '/admin/score/decrease', 'App\Module\Admin\Controller\ScoreController@decrease',['middleware'=>[AdminMiddleware::class]]);
#统计模块
Router::addRoute(['GET'], '/admin/statis/index', 'App\Module\Admin\Controller\StatisController@index',['middleware'=>[AdminMiddleware::class]]);








#教师端
Router::addRoute(['POST'], '/teacher/login/account', 'App\Module\Teacher\Controller\LoginController@account');
#家
Router::addRoute(['GET'], '/teacher/home/info', 'App\Module\Teacher\Controller\HomeController@info',['middleware'=>[TeacherMiddleware::class]]);
Router::addRoute(['POST'], '/teacher/home/password', 'App\Module\Teacher\Controller\HomeController@password',['middleware'=>[TeacherMiddleware::class]]);
#支付记录模块
Router::addRoute(['GET'], '/teacher/pay/search', 'App\Module\Teacher\Controller\PayController@search',['middleware'=>[TeacherMiddleware::class]]);
Router::addRoute(['GET'], '/teacher/pay/use/{id:\d+}', 'App\Module\Teacher\Controller\PayController@use',['middleware'=>[TeacherMiddleware::class]]);
#孩子模块
Router::addRoute(['GET'], '/teacher/child/search', 'App\Module\Teacher\Controller\ChildController@search',['middleware'=>[TeacherMiddleware::class]]);
#足迹模块
Router::addRoute(['GET'], '/teacher/foot/search', 'App\Module\Teacher\Controller\FootController@search',['middleware'=>[TeacherMiddleware::class]]);
Router::addRoute(['POST'], '/teacher/foot/add', 'App\Module\Teacher\Controller\FootController@add',['middleware'=>[TeacherMiddleware::class]]);
Router::addRoute(['GET'], '/teacher/foot/delete/{id:\d+}', 'App\Module\Teacher\Controller\FootController@delete',['middleware'=>[TeacherMiddleware::class]]);






#用户端
Router::addRoute(['POST'], '/user/login/wechat', 'App\Module\User\Controller\LoginController@wechat');
#家
Router::addRoute(['GET'], '/user/home/info', 'App\Module\User\Controller\HomeController@info',['middleware'=>[UserMiddleware::class]]);
#作品模块
Router::addRoute(['GET'], '/user/works/search', 'App\Module\User\Controller\WorksController@search');
Router::addRoute(['GET'], '/user/works/getById/{id:\d+}', 'App\Module\User\Controller\WorksController@getById');
Router::addRoute(['GET'], '/user/works/agree/{id:\d+}', 'App\Module\User\Controller\WorksController@agree',['middleware'=>[UserMiddleware::class]]);
#教师模块
Router::addRoute(['GET'], '/user/teacher/search', 'App\Module\User\Controller\TeacherController@search');
#孩子模块
Router::addRoute(['GET'], '/user/child/search', 'App\Module\User\Controller\ChildController@search',['middleware'=>[UserMiddleware::class]]);
Router::addRoute(['GET'], '/user/child/getById/{id:\d+}', 'App\Module\User\Controller\ChildController@getById',['middleware'=>[UserMiddleware::class]]);
Router::addRoute(['POST'], '/user/child/edit/{id:\d+}', 'App\Module\User\Controller\ChildController@edit',['middleware'=>[UserMiddleware::class]]);
Router::addRoute(['POST'], '/user/child/bind', 'App\Module\User\Controller\ChildController@bind',['middleware'=>[UserMiddleware::class]]);
Router::addRoute(['GET'], '/user/child/unbind/{id:\d+}', 'App\Module\User\Controller\ChildController@unbind',['middleware'=>[UserMiddleware::class]]);
#足迹模块
Router::addRoute(['GET'], '/user/foot/search', 'App\Module\User\Controller\FootController@search',['middleware'=>[UserMiddleware::class]]);
Router::addRoute(['POST'], '/user/foot/add', 'App\Module\User\Controller\FootController@add',['middleware'=>[UserMiddleware::class]]);
Router::addRoute(['GET'], '/user/foot/delete/{id:\d+}', 'App\Module\User\Controller\FootController@delete',['middleware'=>[UserMiddleware::class]]);
Router::addRoute(['GET'], '/user/foot/agree/{id:\d+}', 'App\Module\User\Controller\FootController@agree',['middleware'=>[UserMiddleware::class]]);
Router::addRoute(['GET'], '/user/foot/publish/{id:\d+}', 'App\Module\User\Controller\FootController@publish',['middleware'=>[UserMiddleware::class]]);
#积分模块
Router::addRoute(['GET'], '/user/score/search', 'App\Module\User\Controller\ScoreController@search',['middleware'=>[UserMiddleware::class]]);
#任务模块
Router::addRoute(['GET'], '/user/task/sign', 'App\Module\User\Controller\TaskController@sign',['middleware'=>[UserMiddleware::class]]);
Router::addRoute(['GET'], '/user/task/miniShare/{id:\d+}', 'App\Module\User\Controller\TaskController@miniShare',['middleware'=>[UserMiddleware::class]]);
Router::addRoute(['GET'], '/user/task/activityShare/{sid:\d+}/{aid:\d+}', 'App\Module\User\Controller\TaskController@activityShare',['middleware'=>[UserMiddleware::class]]);
#活动模块
Router::addRoute(['GET'], '/user/activity/search', 'App\Module\User\Controller\ActivityController@search');
Router::addRoute(['GET'], '/user/activity/getById/{id:\d+}', 'App\Module\User\Controller\ActivityController@getById');
Router::addRoute(['GET'], '/user/activity/mine', 'App\Module\User\Controller\ActivityController@mine',['middleware'=>[UserMiddleware::class]]);
#新闻模块
Router::addRoute(['GET'], '/user/news/search', 'App\Module\User\Controller\NewsController@search');
Router::addRoute(['GET'], '/user/news/getById/{id:\d+}', 'App\Module\User\Controller\NewsController@getById');
#轮播模块
Router::addRoute(['GET'], '/user/roll/search', 'App\Module\User\Controller\RollController@search');







#支付端
#支付模块
Router::addRoute(['POST'], '/pay/pay/activity', 'App\Module\Pay\Controller\PayController@activity',['middleware'=>[UserMiddleware::class]]);
#异步通知模块
Router::addRoute(['POST'], '/pay/notify/wechatPayNotify', 'App\Module\Pay\Controller\NotifyController@wechatPayNotify');
